package zoo.member.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.member.domain.MemberCommand;
import zoo.member.domain.MemberMilegeCommand;
import zoo.member.domain.MemberZipCommand;

public class MemberDaoImpl extends SqlSessionDaoSupport implements MemberDao{

	
	public void insert(MemberCommand member) {
		getSqlSession().insert("insert",member);
	}
	
	public MemberCommand getMember(String userid) {
		MemberCommand member = getSqlSession().selectOne("getMember",userid);
		return member;
	}

	@Override
	public void insertMilege(MemberMilegeCommand milige) {
		getSqlSession().insert("insertmilege",milige);
	}
	
	@Override
	public void insertMemberpoint(Map<String,Object> map) {
		getSqlSession().insert("updatemilege",map);
		
	}

	@Override
	public void updateMember(MemberCommand member) {
		getSqlSession().update("updateMember",member);
		
	}

	@Override
	public String list(Map<String, Object> map) { //비밀번호찾기
		String pw=getSqlSession().selectOne("idList",map);
		return pw;
	}
	@Override
	public String list2(Map<String, Object> map) { //아이디찾기
		String id=getSqlSession().selectOne("pwList",map);
		return id;
	}

	@Override
	public void chargePoint(Map<String, Object> map) {
		getSqlSession().update("chargePoint",map);
	}

}
